/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.storebits.testsystem;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Ventsi
 */
@Entity
@Table(name = "hotel")
@NamedQueries({
    @NamedQuery(name = "Hotel.findAll", query = "SELECT h FROM Hotel h")})
public class Hotel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idHotel")
    private Integer idHotel;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "brandName")
    private String brandName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "brandCode")
    private String brandCode;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "country")
    private String country;
    @Basic(optional = false)
    @NotNull
    @Column(name = "countryPhoneCode")
    private int countryPhoneCode;
    @Size(max = 200)
    @Column(name = "address")
    private String address;
    @Column(name = "zip")
    private Integer zip;
    @Size(max = 45)
    @Column(name = "categoryDescription")
    private String categoryDescription;
    @Column(name = "telephone")
    private Integer telephone;
    @Size(max = 200)
    @Column(name = "conveniences")
    private String conveniences;
    @OneToMany(mappedBy = "hotel")
    private Collection<Hotelreservation> hotelreservationCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "hotel1")
    private Collection<Room> roomCollection;

    public Hotel() {
    }

    public Hotel(Integer idHotel) {
        this.idHotel = idHotel;
    }

    public Hotel(Integer idHotel, String name, String brandName, String brandCode, String country, int countryPhoneCode) {
        this.idHotel = idHotel;
        this.name = name;
        this.brandName = brandName;
        this.brandCode = brandCode;
        this.country = country;
        this.countryPhoneCode = countryPhoneCode;
    }

    public Integer getIdHotel() {
        return idHotel;
    }

    public void setIdHotel(Integer idHotel) {
        this.idHotel = idHotel;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getBrandCode() {
        return brandCode;
    }

    public void setBrandCode(String brandCode) {
        this.brandCode = brandCode;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public int getCountryPhoneCode() {
        return countryPhoneCode;
    }

    public void setCountryPhoneCode(int countryPhoneCode) {
        this.countryPhoneCode = countryPhoneCode;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getZip() {
        return zip;
    }

    public void setZip(Integer zip) {
        this.zip = zip;
    }

    public String getCategoryDescription() {
        return categoryDescription;
    }

    public void setCategoryDescription(String categoryDescription) {
        this.categoryDescription = categoryDescription;
    }

    public Integer getTelephone() {
        return telephone;
    }

    public void setTelephone(Integer telephone) {
        this.telephone = telephone;
    }

    public String getConveniences() {
        return conveniences;
    }

    public void setConveniences(String conveniences) {
        this.conveniences = conveniences;
    }

    public Collection<Hotelreservation> getHotelreservationCollection() {
        return hotelreservationCollection;
    }

    public void setHotelreservationCollection(Collection<Hotelreservation> hotelreservationCollection) {
        this.hotelreservationCollection = hotelreservationCollection;
    }

    public Collection<Room> getRoomCollection() {
        return roomCollection;
    }

    public void setRoomCollection(Collection<Room> roomCollection) {
        this.roomCollection = roomCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHotel != null ? idHotel.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hotel)) {
            return false;
        }
        Hotel other = (Hotel) object;
        if ((this.idHotel == null && other.idHotel != null) || (this.idHotel != null && !this.idHotel.equals(other.idHotel))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return name + ", "+ categoryDescription + ", " + address + ", " + country;
    }
    
}
